package kr.co.icebird.temp;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.general.DefaultPieDataset;

public class JfreeChart01 {

	public void createChart() {

		DefaultPieDataset d01 = new DefaultPieDataset();
		d01.setValue("카테고리 01", new Double(43.2));
		d01.setValue("카테고리 02", new Double(27.9));
		d01.setValue("카테고리 03", new Double(66.5));
		d01.setValue("카테고리 04", new Double(36.5));
		d01.setValue("카테고리 05", new Double(46.5));

		JFreeChart chart = ChartFactory.createPieChart("Sample Pie Chart", d01, true, false, false);
		TextTitle tt = new TextTitle();
		tt.setText("한글테스트 01");
		chart.setTitle(tt);
		ChartFrame cf = new ChartFrame("Test", chart);

		cf.pack();
		cf.setVisible(true);

	}
	

	public static void main(String[] args) throws Exception {
		
		JfreeChart01 jf = new JfreeChart01();
		jf.createChart();
	}
}
